import 'package:flutter/material.dart';

/// @date 2020/08/31  10:47
/// @author 程志强
/// @des app支持多语言

class AppLocale extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // 获取当前语言
    Locale locale = Localizations.localeOf(context);

    return Scaffold(
      appBar: AppBar(
        title: Text("app支持多语言"),
      ),
      body: Text("当前语言：" +
          locale.toString() +
          "\nlanguageCode：" +
          locale.languageCode +
          "\ntoLanguageTag：" +
          locale.toLanguageTag() +
          "\ncountryCode：" +
          locale.countryCode),
    );
  }
}
